﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.AndonManagement;

namespace Digitalmes.Model.AndonManagement
{
    /// <summary>
    /// 问题类型
    /// </summary>
	[Table("IssueType")]

    [Display(Name = "_Model.IssueType")]
    public class IssueType : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._IssueType._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._IssueType._IssueName")]
        [Comment("问题名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string IssueName { get; set; }
        [Display(Name = "_Model._IssueType._ActiveColor")]
        [Comment("激活颜色")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string ActiveColor { get; set; }
        [Display(Name = "_Model._IssueType._NormalColor")]
        [Comment("正常颜色")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string NormalColor { get; set; }
        [Display(Name = "_Model._IssueType._Remark")]
        [Comment("备用")]
        public string Remark { get; set; }
        [Display(Name = "_Model._IssueType._Code")]
        [Comment("问题编码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public int? Code { get; set; }
        [Display(Name = "_Model._IssueRecord._IssueType")]
        [InverseProperty("IssueType")]
        public List<IssueRecord> IssueRecord_IssueType { get; set; }
        [Display(Name = "_Model._IssueType._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
